<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<script type="text/javascript">
    /**
     * 自定义验证规则
     */
    function validateForm() {
        form.bootstrapValidator({
            message: "无效的值",
            feedbackIcons: {
                valid: "glyphicon glyphicon-ok",
                invalid: "glyphicon glyphicon-remove",
                validating: "glyphicon glyphicon-refresh"
            },
            fields: {
                plateFormRemark: {
                    validators: {
                        notEmpty: {message: "名称备注不可为空"},
                        stringLength: {max: 100, message: "名称备注最大长度为50"}
                    }
                }
            }
        });
    }

    /**
     * 修改名称备注
     */
	<shiro:hasPermission name="back_gotoFansUserInfoPage_remark">
    function changePlateFormRemark(){
        /**获取选中行的id**/
        var selectedRow = $("#tt").bootstrapTable('getSelections');
        if (selectedRow.length == 1) {
            $("#c_userId").val(selectedRow[0].userId);
            $("#btn_change").attr("data-target", "#changePlateFormRemarkModal");/**选中了记录后才可打开对应的模态框**/
            $.ajax({
                type: "POST",
                dataType: "JSON",
                url: "${basePath}/back/wx/fansUserInfo/getFansUserInfoObject.sjson",
                data: {userId:selectedRow[0].userId},
                success: function(result){
                    var data = JSON.parse(result.data);
                    /**重置详情页中所有html展示信息**/
                    resetDetailTable("detailTableChangePlateFormRemark");
                    /**设置展示信息**/
                    $("#c_userOpenId").html(data.userOpenId);
                    $("#c_nickName").html(data.nickName);
                    if(data.sex=="2"){
                        $("#c_sex").html("女");
                    }else if(data.sex=="1"){
                        $("#c_sex").html("男");
                    }else{
                        $("#c_sex").html("");
                    }
                    $("#c_userCountry").html(data.userCountry);
                    $("#c_userProvince").html(data.userProvince);
                    $("#c_userCity").html(data.userCity);
                    $("#c_userLanguage").html(data.userLanguage);
                    if(data.subscribe=="0"){
                        $("#c_subscribe").html("<font class='color_002'>否</font>");
                    }else if(data.subscribe=="1"){
                        $("#c_subscribe").html("<font class='color_001'>是</font>");
                    }
                    $("#c_remark").html(data.remark);
                    if(data.subscribeTime!=""&&data.subscribeTime!=undefined){
                        $("#c_subscribeTime").html(formatTimeConvert(data.subscribeTime));
                    }
                    $("#c_latitude").html(data.latitude);
                    $("#c_longitude").html(data.longitude);
                    $("#c_precision").html(data.precision);
                    $("#c_plateFormRemark").val(data.plateFormRemark);
                }
            });
        } else {
            $("#btn_change").attr("data-target", "");/**没有选中记录不可打开模态框**/
            showMsg("请选择一行记录！");
        }
    }
	</shiro:hasPermission>
</script>
<!--修改名称备注模态框（Modal） -->
<div class="modal fade" id="changePlateFormRemarkModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">修改名称备注</h5>
			</div>
			<div class="modal-body">
				<form id="form1" method="post" action="${basePath}/back/wx/fansUserInfo/changePlateFormRemark.sjson">
					<input id="c_userId" type="hidden" name="userId" />
					<table id="detailTableChangePlateFormRemark" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
						<tr>
							<td class="toright_td" width="150px">会员标识:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_userOpenId"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">昵称:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_nickName"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">性别:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_sex"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">会员所在国家:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_userCountry"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">会员所在省份:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_userProvince"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">会员所在城市:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_userCity"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">会员语言:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_userLanguage"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">是否订阅该公众号:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_subscribe"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">会员备注:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_remark"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">会员关注时间:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_subscribeTime"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">地理位置纬度:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_latitude"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">地理位置经度:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_longitude"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px">地理位置精度:</td>
							<td class="toleft_td">&nbsp;&nbsp;<span id="c_precision"></span></td>
						</tr>
						<tr>
							<td class="toright_td" width="150px"><span style="color:red">* </span>名称备注:&nbsp;&nbsp;</td>
							<td class="toleft_td">
								<div class="form-group">
									<textarea class="form-control input-sm" type="text" id="c_plateFormRemark" name="plateFormRemark" placeholder="请输入名称备注"></textarea>
								</div>
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div class="modal-footer">
				<button type="button" id="validateBtn" class="btn btn-primary" onclick="submitForm()">保存</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>